package com.kakarote.hrm.constant;

/**
 * 分组状态
 */
public enum EmployeeEncryptFieldTypeEnum {
    QUIT(12, "员工离职信息"),
    SIDELINE(51, "员工兼职信息"),
    POST(11, "员工岗位信息"),
    BASE(1, "员工基本信息"),
    EMERGENCYCONTACT (61, "员工紧急联系人信息"),
    EDUCATION (3, "员工教育经历"),
    WORK (4, "员工工作经历"),
    CERTIFICATE (13, "员工职（执）业资格"),
    TECHNICAL (8, "员工专业技术资格"),
    TECHNICALWORKER (5, "员工专业技术工人证书"),
    CONTACTS (7, "员工家庭成员及主要社会关系"),
    LIST (0, "员工列表"),
    ;

    EmployeeEncryptFieldTypeEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }


    private String name;
    private int value;

    public static String parseName(int type) {
        for (EmployeeEncryptFieldTypeEnum value : EmployeeEncryptFieldTypeEnum.values()) {
            if (value.value == type) {
                return value.name;
            }
        }
        return "";
    }

    public static int valueOfType(String name) {
        for (EmployeeEncryptFieldTypeEnum value : EmployeeEncryptFieldTypeEnum.values()) {
            if (value.name.equals(name)) {
                return value.value;
            }
        }
        return -1;
    }

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }
}
